<template>
  <div>
    <el-row :gutter="12">
      <el-col :span="8">
        <el-card shadow="always" style="text-align:center">
          有没有树枝
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover" style="text-align:center">
          荔枝一点！都给我荔枝一点！
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="never" style="text-align:center">
          小黑子露出鸡脚了吧
        </el-card>
      </el-col>
    </el-row>
    <div style="margin-top: 1vw" class="mycard">
      <span class="words">推荐歌单<i class="el-icon-arrow-right"></i></span>
      <el-row>
        <el-col :span="3" v-for="(item, index) in zjList" :key="index" :offset="index % 5 == 0 ? 0 : 2">
          <el-card :body-style="{ padding: '0px' }" style="width: 13.1vw">
            <img :src="item.pic" class="image" style="height:15vw">
            <div style="padding: 10px; text-align: center;">
              <span @click="songdetail(item.aid)">{{ item.aname }}</span>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
export default {
  name: "HomeMain",
  components: {},
  data() {
    return {
      zjList: [],
    }
  },
  created() {
    this.getzjList();
  },
  methods: {
    async getzjList() {
      const reszj = await this.$http.get('music/findAllAlbum');
      this.zjList = reszj.data.data;
      // console.log(this.zjList);
    },
    songdetail(id) {
      console.log(id);
      this.$router.push({
        path: '/SongDetail',
        query: { zjnum: id }
      });
    }
  }
}
</script>
<style lang="less">
.words {
  font-size: 2rem;
  padding-left: 20px;
  color: #ffffff;
  text-shadow: -3px -2px 3px #dbdada, 4px 3px 3px #444444;
}

.mycard {
  padding-top: 20px;
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.2);
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}

.el-card {
  margin-top: 30px;
}

.el-card__header {
  background: #5a8cbb;
  color: #ffffff;
}

.cardfenlei {
  height: 14vw
}

.image {
  width: 100%;
  display: block;
}
</style>